package com.imooc.maokeyang.alllearning.domain.common;


import lombok.Data;

import javax.validation.Valid;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

/**
 * 通用分页查询对象
 *
 * @param <T>
 */
@Data
public class PageQuery<T> {


    @NotNull(message = "页号不能为空")
    @Min(value = 1, message = "页号必须为整数")
    private Integer pageNo = 1;


    @NotNull(message = "每页条数不能为空")
    @Max(value = 100, message = "每页条数不能超过100条")
    private Integer pageSize = 20;


    /**
     * 动态查询
     */
    @Valid
    @NotNull(message = "动态查询条件不能为空")
    private T query;

}
